Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle missing latest tag during version check #90

Merged
merged 8 commits into from
May 1, 2023

Conversation

mcous
Copy link
Member

@mcous mcous commented Apr 29, 2023

Overview

This PR makes two changes to how the calls to npm view and npm publish are made:

  1. If npm view package-name comes back empty due to [BUG] npm view package@latest exits with code 0 and no output if latest tag does not exist npm/cli#6408, we will now retry with npm view package-name@tag, to try to get some information
  2. If npm publish fails because the requested version already exists, the action will not fail.

Fixes #89

Change details

  • Restructured how the npmPublish function is broken up to delegate to a new compareAndPublish function
    • This change means only one temporary .npmrc file is created, rather than two
  • Renamed and reorganized some things for consistency

@mcous mcous changed the title Handle missing latest tag during version check fix: handle missing latest tag during version check Apr 30, 2023
@mcous mcous marked this pull request as ready for review May 1, 2023 12:10
@mcous mcous merged commit 69c6427 into main May 1, 2023
@mcous mcous deleted the fix-no-latest-tag-89 branch May 1, 2023 20:03
@mcous mcous mentioned this pull request May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version check fails if latest tag does not exist in registry
1 participant